package org.tarena.dang.action.cart;

import java.sql.SQLException;
import org.tarena.dang.action.BaseAction;
import org.tarena.dang.service.CartFactory;
import org.tarena.dang.service.CartService;


public class BuyAction extends BaseAction {
	private int id;
	private boolean ok;
	public String execute(){
		System.out.println("bu action 执行了***");
		CartService cartServic = CartFactory.getCart(session);
		try {
			ok = cartServic.buy(id);
			System.out.println("购买"+ok);
			
		} catch (SQLException e) {
			// Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return "success";
	}
	public boolean isOk() {
		return ok;
	}
	public void setOk(boolean ok) {
		this.ok = ok;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
}
